From 87beb45e0b05be76755cac53322aae4f5b426aac Mon Sep 17 00:00:00 2001 From: Dongli Zhang Date: Wed, 15 Jun 2016 21:07:53 +0800 Subject: [PATCH] tools/livepatch: initialise j to 0 to fix compilation error in gcc 4.5 Initialise j to 0 to make some versions of gcc (e.g., gcc4.5/4.3) happy to avoid compilation error by commit beba3693f7243e68bbe31fe3794da91068eeea5b. Failure manifests with gcc 4.5 as: [ 153s] cc1: warnings being treated as errors [ 153s] xen-livepatch.c: In function 'main': [ 153s] xen-livepatch.c:415:12: error: 'j' may be used uninitialized in this function [ 153s] make[3]: *** [xen-livepatch.o] Error 1 Signed-off-by: Dongli Zhang Acked-by: Wei Liu --- tools/misc/xen-livepatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c index 316248979c..62c072ec3a 100644 --- a/tools/misc/xen-livepatch.c +++ b/tools/misc/xen-livepatch.c @@ -412,7 +412,7 @@ struct { int main(int argc, char *argv[]) { - int i, j, ret; + int i, j = 0, ret; if ( argc <= 1 ) { -- 2.30.2